﻿@{
    ViewBag.Title = "DeliveryInDetail";
}

@section scripts
{   
    <script src="@Url.Content("~/Scripts/shared/share.js")" type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/shared/shown.js")" type="text/javascript"></script>  
    <script src="@Url.Content("~/Scripts/common/gridlayout.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/common/export.js")" type="text/javascript"></script>
}
<body>
   <form id="form1" runat="server" method="post" style="height: 100%">
    
    @Html.Partial("~/Views/Modular/BillDetailToolbar.cshtml")
    
    <div id = "DivHeader">
        <table style="margin-bottom:4px;">
            <tr>
                <td width ="70px" align="right">单据日期：</td>
                <td width ="310px">
                    @Html.Partial("~/Views/Modular/dxDateRange.cshtml") 
                </td>
                <td width ="70px" align="right">要货门店：</td>
                <td width ="190px">    
                    @Html.Partial("~/Views/Modular/LookupStockInfo.cshtml")  
                </td>
                <td width ="70px" align="right">商品搜索：</td>
                <td width ="150px">
                    <input name="FNumber" class="mini-textbox" style="width:150px;"/>
                </td>
            </tr>
            <tr>
                <td width ="70px" align="right">单据编号：</td>
                <td width ="310px">
                    <input name="FBillNo" class="mini-textbox" style="width:295px;"/>
                </td>
                <td width ="70px" align="right">配送门店：</td>
                <td width ="190px">    
                     @Html.Partial("~/Views/Delivery/LookupStockRelevant.cshtml")                      
                </td>
                <td width ="70px" align="right">单据状态：</td>
                <td width ="150px">
                    <input id="comListType" name ="FListType" class="mini-combobox" style="width:150px;" 
                    showNullItem="false" value="0" allowInput="false" align="left" data ="dListType"/>  
                </td>
            </tr>
        </table>
    </div>

    <div class="mini-fit">
        <div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;" borderStyle="border:1;"pageSize="15"
            url="../Report/GetBillDetail"
            allowCellSelect="true" allowCellEdit="true" showSummaryRow="true" ondrawsummarycell="onDrawSummaryCell"
            fitColumns="false" onrowdblclick="editBill" sortMode="client">
            <div property="columns">
                <div field="FBillNo" width="120" headerAlign="center">单据编号</div>    
                <div field="FDate" name="FDate" width="90px" dateFormat="yyyy-MM-dd" headerAlign="center">单据日期</div> 
                <div field="FNumber" width="100" headerAlign="center">商品编码</div> 
                <div field="FCode" width="110" headerAlign="center">商品条码</div>
                <div field="FName" width="130" headerAlign="center">商品名称</div>
                <div field="FSpec" width="80" headerAlign="center">规格型号</div>
                <div field="FUnitName" width="40" headerAlign="center">单位</div>
                <div field="mFQty_DawOut" name="mFQty_DawOut" width="80" headerAlign="center" align="right">配送数量</div> 
                <div field="mFQty" name="mFQty" width="80" headerAlign="center" align="right">入库数量</div>                
                <div field="mFPrice" name="mFPrice" width="80" numberFormat="#,0.00" headerAlign="center" align="right">单价</div>
                <div field="mFAmount" name="mFAmount" numberFormat="#,0.00" width="80" headerAlign="center" align="right" summaryType="sum">金额</div>                                              
                <div field="FSetStockName" width="150" headerAlign="center">配送门店</div>
                <div field="FGetStockName" width="150" headerAlign="center">要货门店</div>
                <div field="FUserName" width="80" headerAlign="center">用户名称</div>
                <div field="mFBillNO_Pra" width="120" headerAlign="center">要货单号</div>
                <div field="mFBillNO_DawOut" width="120" headerAlign="center">配送单号</div>
                <div field="mFRemark" name="mFRemark" headerCls="CellLast" width="150" headerAlign="center" >备注</div>
            </div>
        </div>  
    </div>
    
    <script type="text/javascript">
        var dListType = [{ "id": "0", "text": "全部" },
                         { "id": "1", "text": "未审核" },
                         { "id": "2", "text": "已审核" }]

        mini.parse();
        var form = new mini.Form("form1");
        var grid = mini.get("datagrid1");
        var uID = parent.window.getSystemAppID();
        var sumFields = "mFQty,mFQty_DawOut,mFAmount";

        function FormShown() {
            var nowDate = new Date();
            mini.getbyName("FDate1").setValue(nowDate);
            mini.getbyName("FDate2").setValue(nowDate);
            LoadData();
        }
        function editBill() {
            if (!mini.get("editbill").getVisible()) return;
            var row = grid.getSelected();
            if (row) {
                parent.window.showTabByIdEx('83', 'DeliveryIn', '配送入库', '../Delivery/DeliveryIn?datatype=11&billid=' + row.KInterID);
            }
        }
        function clearloca() {
            mini.getbyName("FStockID").setValue("");
            mini.getbyName("FStockID").setText("");
            mini.getbyName("FStockName").setValue("");
            mini.getbyName("FRStockID").setValue("");
            mini.getbyName("FRStockID").setText("");
            mini.getbyName("FRStockName").setValue("");
            mini.getbyName("FNumber").setValue("");
        }

        function LoadData() {
            var cDate1 = mini.getbyName("FDate1").getFormValue();
            var cDate2 = mini.getbyName("FDate2").getFormValue();
            var mListType = mini.getbyName("FListType").getValue();
            var mBillNo = mini.getbyName("FBillNo").getValue();
            var mStockID = mini.getbyName("FRStockID").getValue();
            var FRStockID = mini.getbyName("FStockID").getValue();
            var mNumber = mini.getbyName("FNumber").getValue();

            var json = "[{";
            json = json + '"mListType":' + '"' + "29" + '",';//列表类型
            json = json + '"mSystemAppID":' + '"' + uID + '",';
            json = json + '"mDate1":' + '"' + cDate1 + '",';
            json = json + '"mDate2":' + '"' + cDate2 + '",';
            json = json + '"mCheckFlag":' + '"' + mListType + '",';
            json = json + '"mDataType":' + '"0",';
            json = json + '"mStockID":' + '"' + FRStockID + '",';
            json = json + '"mRStockID":' + '"' + mStockID + '",';
            json = json + '"mNumber":' + '"' + mNumber + '",';
            json = json + '"mBillNo":' + '"' + mBillNo + '"';
            json = json + "}]";

            grid.load({ mydata: json });

            mExportDataUrl = grid.url;
            mExportDataJson = json;//导出
        }

    </script>
          </form>

</body>
